<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" class="form-control" data-rule="required" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Condition')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-condition_ids" placeholder="不选择时表示不限制" data-source="shop/coupon_condition/index" class="form-control selectpage" name="row[condition_ids]" type="text" data-multiple="true" value="{$row.condition_ids|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Result')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select id="c-result" class="form-control selectpicker" name="row[result]">
                {foreach name="resultList" item="vo"}
                <option value="{$key}" {in name="key" value="$row.result" }selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8" style="display: flex;align-items: center;">
            <div>订单满&nbsp;</div>
            <div><input class="form-control" data-rule="required" name="row[result_data][money]" value="{if isset($row['result_data']['money'])}{$row['result_data']['money']}{/if}" type="number"></div>
            <div>&nbsp;元，<span id="text-a">{if $row.result==1}减{else/}打{/if}</span>&nbsp;</div>
            <div><input class="form-control" data-rule="required" name="row[result_data][number]" value="{if isset($row['result_data']['number'])}{$row['result_data']['number']}{/if}" type="number"></div>
            <div style="margin-left: 5px;" id="text-b">{if $row.result==1}元{else/}折{/if}</div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Give_num')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-give_num" class="form-control" data-rule="required" name="row[give_num]" type="number" value="{$row.give_num|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Allow_num')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-allow_num" class="form-control" data-rule="required" name="row[allow_num]" type="number" value="{$row.allow_num|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Is_open')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select id="c-is_open" class="form-control selectpicker" name="row[is_open]">
                {foreach name="isOpenList" item="vo"}
                <option value="{$key}" {in name="key" value="$row.is_open" }selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Is_private')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
            {foreach name="IsPrivateList" item="vo"}
            <label for="row[is_private]-{$key}"><input id="row[is_private]-{$key}" name="row[is_private]" type="radio" value="{$key}" {in name="key" value="$row.is_private"}checked{/in} /> {$vo}</label>
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Receive_times')}:</label>
        <div class="col-xs-12 col-sm-8 receive_times">
            <input id="c-receive_times" data-rule="required" class="form-control datetimerange" autocomplete="off" data-use-current="true" name="row[receive_times]" type="text" value="{$row.receive_times}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Mode')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
            {foreach name="modeList" item="vo"}
            <label for="row[mode]-{$key}"><input id="row[mode]-{$key}" name="row[mode]" class="modes" type="radio" value="{$key}" {in name="key" value="$row.mode"}checked{/in} /> {$vo}</label>
            {/foreach}
            </div>

        </div>
    </div>
    <div id="modetpl">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Use_times')}:</label>
            <div class="col-xs-12 col-sm-8 use_times">
                {if $row.mode != 'fixation'}
                <input id="c-use_times" data-rule="required" class="form-control datetimerange" autocomplete="off" data-use-current="true" name="row[use_times]" type="text" value="{$row.use_times}">
                {else/}
                <input id="c-use_times" data-rule="required" class="form-control" name="row[use_times]" autocomplete="off" type="text" placeholder="表示未来X天内有效" value="{$row.use_times}">
                {/if}
            </div>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
{include file="shop/coupon/modetpl" /}
